package com.smartleanx.module.hrm.controller.app.eagin;

import com.alibaba.fastjson2.JSONObject;
import com.smartleanx.framework.common.pojo.CommonResult;
import com.smartleanx.module.hrm.service.esign.service.ElecPsnSealService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "个人印章")
@RestController
@RequestMapping("/hrm/app/esign/pasnSeal")
@AllArgsConstructor
public class EsignPsnSealAppController {

    @Autowired
    private ElecPsnSealService elecPsnSealService;

    @PostMapping("/createPsnSealUrl")
    public CommonResult<Object> createPsnSealUrl(@RequestBody JSONObject params)
    {
        String redirectUrl = params.getString("redirectUrl");
        String panSealUrl = elecPsnSealService.createPanSealUrl(redirectUrl);
        return CommonResult.success(panSealUrl);
    }

}
